import {
  queryBrandItemListService,
  getCenterItemListService,
  getBrandSeriesBySeriesNameService
} from '@/api/public';

export const COMPARE_CONDITION = [
  {
    value: 'gt',
    label: '大于'
  },
  {
    value: 'lt',
    label: '小于'
  }
]

export const FORM_ITEMS = [
  {
    prop: 'categoryUuids',
    label: '品类',
    type: 'slot',
    slotName: 'category',
    defaultVal: []
  },
  {
    prop: 'categoryNo',
    label: '四级类编码',
    type: 'input'
  },
  {
    prop: 'brandUuid', // 联想搜索，传id
    label: '品牌',
    type: 'select',
    remote: true,
    remoteMethod: queryBrandItemListService,
    paramKey: 'brandName'
  },
  {
    prop: 'seriesUuid',
    label: '系列',
    type: 'select',
    remote: true,
    remoteMethod: getBrandSeriesBySeriesNameService,
    paramKey: 'seriesName',
    optionKeys: { valueKey: 'seriesUuid', labelKey: 'seriesName', codeKey: 'brandName' },
  },
  {
    prop: 'centerDepartments',
    label: '归属中心',
    type: 'select',
    remote: true,
    remoteMethod: getCenterItemListService,
    multiple: true,
    paramKey: 'centerName',
    reserveKeyword: true,
  },
  {
    prop: 'guideAddRate',
    label: '售价指导加价率',
    width: '130px',
    type: 'range',
    rangeType: 'inputNum',
    precision: 2,
    props: ['guideAddRateFrom', 'guideAddRateTo']
  },
  {
    prop: 'sellWellAddRate',
    label: '畅销指导加价率',
    width: '130px',
    type: 'range',
    rangeType: 'inputNum',
    precision: 2,
    props: ['sellWellAddRateFrom', 'sellWellAddRateTo']
  },
  {
    prop: 'limitAddRate',
    label: '成交最低加价率',
    width: '130px',
    type: 'range',
    rangeType: 'inputNum',
    precision: 2,
    props: ['limitAddRateFrom', 'limitAddRateTo']
  },
]

export const TABLE_COLUMNS = [
  {
    title: '品类树',
    key: 'categoryPath',
  },
  {
    title: '四级类名称',
    key: 'categoryName'
  },
  {
    title: '四级类编码',
    key: 'categoryNo'
  },
  {
    title: '品牌ID',
    key: 'brandUuid'
  },
  {
    title: '品牌名称',
    key: 'brandName'
  },
  {
    title: '系列',
    key: 'seriesName'
  },
  {
    title: '创建人',
    key: 'createOperName'
  },
  {
    title: '创建时间',
    key: 'createOpeTime'
  },
  {
    title: '归属中心',
    key: 'belongToCenter'
  },
  {
    title: '售价指导加价率',
    key: 'guideAddRate'
  },
  {
    title: '畅销指导加价率',
    key: 'sellWellAddRate'
  },
  {
    title: '成交最低加价率',
    key: 'limitAddRate'
  }
]
